package com.frame.common.core.config;

import com.frame.common.core.handler.GlobalRestErrorHandler;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @auther zhangwj
 * @date 2021/4/13 上午11:32
 */
@Configuration
public class GlobalRestTemplate {

    @Bean
    public RestTemplate restTemplate() {
        RestTemplate restTemplate = new RestTemplate();
        restTemplate.setErrorHandler(new GlobalRestErrorHandler());
        return restTemplate;
    }
}
